<template>
    <div class="stick-wrapper">
        <div class="stick-pre">
            <Checkbox v-model="isBad" v-if="bad" @on-change="routeWarningStatus">
                <i class="icon icon-bad"></i>
            </Checkbox>
        </div>
        <div class="stick">
            <span
                class="bullet"
                :class="{ 'bullet-red': bad, 'bullet-green': good }"
            ></span>
            <div class="stick-header">
                {{ title }}
            </div>
            <div class="stick-body">
                <span class="number">{{ number }}</span>
                <span class="unit">{{ unit }}</span>
            </div>
        </div>
    </div>
</template>

<script>
    import bus from "@/lib/bus";
    export default {
        name: "",
        data() {
            return {
                isBad: false,
            };
        },
        props: {
            bad: {
                type: Boolean,
                default: false,
            },
            good: {
                type: Boolean,
                default: false,
            },
            title: {
                type: String,
            },
            number: {
                type: Number,
            },
            unit: {
                type: String,
            },
        },
        methods:{
            routeWarningStatus() {
                if(this.isBad){
                    this.$emit('on-warning-checked');
                }else{
                    this.$emit('on-warning-unchecked');
                }
            }
            // setState_waterQuality(){
            //     this.RenderPOI(uniFetcherEcological.getWaterWarningPOI)
            //     this.CameraObj.focusOn('POI')
            // },
            // remove_waterQuality(){
            //     this.RemovePOI("水")
            // },
            // setState_earthQuality(){
            //     this.RenderPOI(uniFetcherEcological.getSoilWarningPOI)
            //     this.CameraObj.focusOn('POI')
            // },
            // remove_earthQuality(){
            //     this.RemovePOI("土壤")
            // },
            // setState_forestStorage(){
            //     this.RenderPOI(uniFetcherEcological.getPlantWarningPOI)
            //     this.CameraObj.focusOn('POI')
            // },
            // remove_forestStorage(){
            //     this.RemovePOI("植物")
            // },
            // setState_AirQuality(){
            //     this.RenderPOI(uniFetcherEcological.getAirWarningPOI)
            //     this.CameraObj.focusOn('POI')
            // },
            // remove_AirQuality(){
            //     this.RemovePOI("气象空气")
            // },
            // setState_birds(){
            //     this.RenderPOI(uniFetcherEcological.getAnimalWarningPOI)
            //     this.CameraObj.focusOn('POI')
            // },
            // remove_birds(){
            //     this.RemovePOI("动物")
            // },
            // setState_mammal(){
            //     this.RenderPOI(uniFetcherEcological.getAnimalWarningPOI)
            //     this.CameraObj.focusOn('POI')
            // },
            // remove_mammal(){
            //     this.RemovePOI("动物")
            // },
            // setState_air(){
            //     this.RenderPOI(uniFetcherEcological.getAirWarningPOI)
            //     this.CameraObj.focusOn('POI')
            // },
            // remove_air(){
            //     this.RemovePOI("气象空气")
            // },
            // setState_NOI(){
            //     this.RenderPOI(uniFetcherEcological.getAirWarningPOI)
            //     this.CameraObj.focusOn('POI')
            // },
            // remove_NOI(){
            //     this.RemovePOI("气象空气")
            // }
        }
    };
</script>

<style scoped>
</style>